VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "msdatgrd.ocx"
Object = "{B3FB64BF-91F9-11D7-A482-0008A14158BC}#2.22#0"; "ITGControls.ocx"
Begin VB.Form frmBasicAPPMSEXPENSE 
   BackColor       =   &H00F7D9C2&
   BorderStyle     =   0  'None
   Caption         =   "Form1"
   ClientHeight    =   8265
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   13485
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   8265
   ScaleWidth      =   13485
   ShowInTaskbar   =   0   'False
   Begin ITGControls.ITGTab SSTab1 
      Height          =   7755
      Left            =   45
      TabIndex        =   0
      Top             =   15
      Width           =   13095
      _ExtentX        =   23098
      _ExtentY        =   13679
      TabCount        =   2
      TabCaption(0)   =   "               Main               "
      TabContCtrlCnt(0)=   14
      Tab(0)ContCtrlCap(1)=   "txtamount"
      Tab(0)ContCtrlCap(2)=   "SSTab2"
      Tab(0)ContCtrlCap(3)=   "ComunionFrames5"
      Tab(0)ContCtrlCap(4)=   "ComunionLabel2"
      Tab(0)ContCtrlCap(5)=   "cboType"
      Tab(0)ContCtrlCap(6)=   "txtTranNo"
      Tab(0)ContCtrlCap(7)=   "dtbDate"
      Tab(0)ContCtrlCap(8)=   "txtGross"
      Tab(0)ContCtrlCap(9)=   "ComunionLabel3"
      Tab(0)ContCtrlCap(10)=   "txtOutputTax"
      Tab(0)ContCtrlCap(11)=   "txtEWT"
      Tab(0)ContCtrlCap(12)=   "txtExpense"
      Tab(0)ContCtrlCap(13)=   "txtAdvance"
      Tab(0)ContCtrlCap(14)=   "txtType"
      TabCaption(1)   =   "               List               "
      TabContCtrlCnt(1)=   1
      Tab(1)ContCtrlCap(1)=   "dtgList"
      TabTheme        =   2
      ActiveTabBackStartColor=   16250865
      ActiveTabBackEndColor=   16243138
      InActiveTabBackStartColor=   16243138
      InActiveTabBackEndColor=   16243138
      InActiveTabForeColor=   0
      BeginProperty ActiveTabFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty InActiveTabFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      OuterBorderColor=   4210752
      TopLeftInnerBorderColor=   4210752
      BottomRightInnerBorderColor=   4210752
      DisabledTabBackColor=   16243138
      DisabledTabForeColor=   -2147483630
      Begin ITGControls.ITGTextBox txtamount 
         Height          =   285
         Left            =   480
         TabIndex        =   35
         TabStop         =   0   'False
         Top             =   6780
         Width           =   2850
         _ExtentX        =   4815
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BackColor       =   14737632
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   "0"
         DataType        =   1
         DecimalPlace    =   2
         Label           =   "Total Amount"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   1450
         TextBoxWidth    =   1340
         Enabled         =   0   'False
         LinkForeColor   =   0
      End
      Begin ITGControls.ITGTab SSTab2 
         Height          =   2910
         Left            =   0
         TabIndex        =   26
         Top             =   3285
         Width           =   13065
         _ExtentX        =   23045
         _ExtentY        =   5133
         TabCount        =   2
         TabCaption(0)   =   "     List of Expense"
         TabContCtrlCnt(0)=   1
         Tab(0)ContCtrlCap(1)=   "ComunionFrames2"
         TabCaption(1)   =   "    List of Voucher"
         TabContCtrlCnt(1)=   1
         Tab(1)ContCtrlCap(1)=   "dtgvoucher"
         ActiveTab       =   1
         TabTheme        =   2
         ActiveTabBackStartColor=   16250865
         ActiveTabBackEndColor=   16243138
         InActiveTabBackStartColor=   16243138
         InActiveTabBackEndColor=   16243138
         ActiveTabForeColor=   0
         InActiveTabForeColor=   0
         BeginProperty ActiveTabFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty InActiveTabFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         OuterBorderColor=   4210752
         TopLeftInnerBorderColor=   4210752
         BottomRightInnerBorderColor=   4210752
         DisabledTabBackColor=   16243138
         DisabledTabForeColor=   -2147483627
         HoverColorInverted=   4210752
         Begin MSDataGridLib.DataGrid dtgvoucher 
            Height          =   2595
            Left            =   0
            TabIndex        =   34
            Top             =   315
            Width           =   13065
            _ExtentX        =   23045
            _ExtentY        =   4577
            _Version        =   393216
            HeadLines       =   1
            RowHeight       =   15
            FormatLocked    =   -1  'True
            BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ColumnCount     =   5
            BeginProperty Column00 
               DataField       =   "cTranNo"
               Caption         =   "Tranno"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column01 
               DataField       =   "cCompanyID"
               Caption         =   "Company ID"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column02 
               DataField       =   "cReference"
               Caption         =   "Ref Voucher"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            BeginProperty Column03 
               DataField       =   "nAmount"
               Caption         =   "Amount"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   1
                  Format          =   "#,##0.00"
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   2
               EndProperty
            EndProperty
            BeginProperty Column04 
               DataField       =   "nAmtVoucher"
               Caption         =   "n"
               BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                  Type            =   0
                  Format          =   ""
                  HaveTrueFalseNull=   0
                  FirstDayOfWeek  =   0
                  FirstWeekOfYear =   0
                  LCID            =   1033
                  SubFormatType   =   0
               EndProperty
            EndProperty
            SplitCount      =   1
            BeginProperty Split0 
               BeginProperty Column00 
                  Object.Visible         =   0   'False
                  ColumnWidth     =   1500.095
               EndProperty
               BeginProperty Column01 
                  Object.Visible         =   0   'False
                  ColumnWidth     =   0
               EndProperty
               BeginProperty Column02 
                  Button          =   -1  'True
                  Locked          =   -1  'True
                  ColumnWidth     =   1800
               EndProperty
               BeginProperty Column03 
                  Alignment       =   1
                  ColumnWidth     =   1800
               EndProperty
               BeginProperty Column04 
                  Object.Visible         =   0   'False
               EndProperty
            EndProperty
         End
         Begin ITGControls.ComunionFrames ComunionFrames2 
            Height          =   3285
            Left            =   -75000
            Top             =   315
            Width           =   13095
            _ExtentX        =   23098
            _ExtentY        =   5794
            FrameColor      =   4210752
            BackColor       =   16243138
            FillColor       =   16243138
            RoundedCorner   =   0   'False
            Caption         =   "Details"
            Alignment       =   0
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ThemeColor      =   5
            ColorFrom       =   16243138
            ColorTo         =   16250865
            Begin VB.ComboBox cboTaxType 
               Appearance      =   0  'Flat
               BackColor       =   &H00FFFFFF&
               Height          =   315
               ItemData        =   "frmBasicAPPMSEXPENSE.frx":0000
               Left            =   3030
               List            =   "frmBasicAPPMSEXPENSE.frx":000D
               Style           =   2  'Dropdown List
               TabIndex        =   32
               Top             =   1305
               Visible         =   0   'False
               Width           =   1170
            End
            Begin VB.ComboBox cboClass 
               BackColor       =   &H00FFFFFF&
               Height          =   315
               ItemData        =   "frmBasicAPPMSEXPENSE.frx":0029
               Left            =   945
               List            =   "frmBasicAPPMSEXPENSE.frx":0033
               Style           =   2  'Dropdown List
               TabIndex        =   31
               Top             =   1035
               Visible         =   0   'False
               Width           =   1170
            End
            Begin VB.ComboBox cboAsk 
               BackColor       =   &H00FFFFFF&
               Height          =   315
               ItemData        =   "frmBasicAPPMSEXPENSE.frx":004B
               Left            =   1410
               List            =   "frmBasicAPPMSEXPENSE.frx":0055
               Style           =   2  'Dropdown List
               TabIndex        =   30
               Top             =   1425
               Visible         =   0   'False
               Width           =   1170
            End
            Begin VB.ComboBox cboParticular 
               BackColor       =   &H00FFFFFF&
               Height          =   315
               ItemData        =   "frmBasicAPPMSEXPENSE.frx":0062
               Left            =   5400
               List            =   "frmBasicAPPMSEXPENSE.frx":00AE
               Style           =   2  'Dropdown List
               TabIndex        =   29
               Top             =   1005
               Visible         =   0   'False
               Width           =   2280
            End
            Begin MSDataGridLib.DataGrid dtgExpense 
               Height          =   2115
               Left            =   60
               TabIndex        =   33
               Top             =   465
               Width           =   13050
               _ExtentX        =   23019
               _ExtentY        =   3731
               _Version        =   393216
               AllowUpdate     =   -1  'True
               AllowArrows     =   -1  'True
               Appearance      =   0
               BackColor       =   16777215
               BorderStyle     =   0
               HeadLines       =   1
               RowHeight       =   15
               TabAcrossSplits =   -1  'True
               TabAction       =   2
               FormatLocked    =   -1  'True
               AllowDelete     =   -1  'True
               BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
                  Name            =   "Tahoma"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ColumnCount     =   13
               BeginProperty Column00 
                  DataField       =   "cType"
                  Caption         =   "Type"
                  BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                     Type            =   0
                     Format          =   ""
                     HaveTrueFalseNull=   0
                     FirstDayOfWeek  =   0
                     FirstWeekOfYear =   0
                     LCID            =   1033
                     SubFormatType   =   0
                  EndProperty
               EndProperty
               BeginProperty Column01 
                  DataField       =   "cDesc"
                  Caption         =   "Description"
                  BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                     Type            =   0
                     Format          =   ""
                     HaveTrueFalseNull=   0
                     FirstDayOfWeek  =   0
                     FirstWeekOfYear =   0
                     LCID            =   1033
                     SubFormatType   =   0
                  EndProperty
               EndProperty
               BeginProperty Column02 
                  DataField       =   "dDate"
                  Caption         =   "Date"
                  BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                     Type            =   1
                     Format          =   "M/d/yyyy"
                     HaveTrueFalseNull=   0
                     FirstDayOfWeek  =   0
                     FirstWeekOfYear =   0
                     LCID            =   1033
                     SubFormatType   =   3
                  EndProperty
               EndProperty
               BeginProperty Column03 
                  DataField       =   "cRefNo"
                  Caption         =   "Reference"
                  BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                     Type            =   0
                     Format          =   "#,##0.00"
                     HaveTrueFalseNull=   0
                     FirstDayOfWeek  =   0
                     FirstWeekOfYear =   0
                     LCID            =   1033
                     SubFormatType   =   0
                  EndProperty
               EndProperty
               BeginProperty Column04 
                  DataField       =   "cParticulars"
                  Caption         =   "Particulars"
                  BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                     Type            =   0
                     Format          =   "#,##0.00"
                     HaveTrueFalseNull=   0
                     FirstDayOfWeek  =   0
                     FirstWeekOfYear =   0
                     LCID            =   1033
                     SubFormatType   =   0
                  EndProperty
               EndProperty
               BeginProperty Column05 
                  DataField       =   "nAmount"
                  Caption         =   "Amount"
                  BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                     Type            =   1
                     Format          =   "#,##0.00"
                     HaveTrueFalseNull=   0
                     FirstDayOfWeek  =   0
                     FirstWeekOfYear =   0
                     LCID            =   1033
                     SubFormatType   =   1
                  EndProperty
               EndProperty
               BeginProperty Column06 
                  DataField       =   "cAcctNo"
                  Caption         =   "Account"
                  BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                     Type            =   0
                     Format          =   "#,##0.00"
                     HaveTrueFalseNull=   0
                     FirstDayOfWeek  =   0
                     FirstWeekOfYear =   0
                     LCID            =   1033
                     SubFormatType   =   0
                  EndProperty
               EndProperty
               BeginProperty Column07 
                  DataField       =   "cCode"
                  Caption         =   "Supplier"
                  BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                     Type            =   0
                     Format          =   "#,##0.00"
                     HaveTrueFalseNull=   0
                     FirstDayOfWeek  =   0
                     FirstWeekOfYear =   0
                     LCID            =   1033
                     SubFormatType   =   0
                  EndProperty
               EndProperty
               BeginProperty Column08 
                  DataField       =   "cVat"
                  Caption         =   "Taxable?"
                  BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                     Type            =   0
                     Format          =   ""
                     HaveTrueFalseNull=   0
                     FirstDayOfWeek  =   0
                     FirstWeekOfYear =   0
                     LCID            =   13321
                     SubFormatType   =   0
                  EndProperty
               EndProperty
               BeginProperty Column09 
                  DataField       =   "cTaxType"
                  Caption         =   "Tax Type"
                  BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                     Type            =   0
                     Format          =   ""
                     HaveTrueFalseNull=   0
                     FirstDayOfWeek  =   0
                     FirstWeekOfYear =   0
                     LCID            =   1033
                     SubFormatType   =   0
                  EndProperty
               EndProperty
               BeginProperty Column10 
                  DataField       =   "nEWTRate"
                  Caption         =   "EWT Rate"
                  BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                     Type            =   1
                     Format          =   "#,##0.00"
                     HaveTrueFalseNull=   0
                     FirstDayOfWeek  =   0
                     FirstWeekOfYear =   0
                     LCID            =   1033
                     SubFormatType   =   1
                  EndProperty
               EndProperty
               BeginProperty Column11 
                  DataField       =   "cTIN"
                  Caption         =   "TIN "
                  BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                     Type            =   0
                     Format          =   ""
                     HaveTrueFalseNull=   0
                     FirstDayOfWeek  =   0
                     FirstWeekOfYear =   0
                     LCID            =   1033
                     SubFormatType   =   0
                  EndProperty
               EndProperty
               BeginProperty Column12 
                  DataField       =   "cPCcode"
                  Caption         =   "Profit Center"
                  BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
                     Type            =   0
                     Format          =   ""
                     HaveTrueFalseNull=   0
                     FirstDayOfWeek  =   0
                     FirstWeekOfYear =   0
                     LCID            =   1033
                     SubFormatType   =   0
                  EndProperty
               EndProperty
               SplitCount      =   1
               BeginProperty Split0 
                  BeginProperty Column00 
                     Button          =   -1  'True
                     Locked          =   -1  'True
                     Object.Visible         =   0   'False
                     ColumnWidth     =   1200.189
                  EndProperty
                  BeginProperty Column01 
                     ColumnWidth     =   2789.858
                  EndProperty
                  BeginProperty Column02 
                     ColumnWidth     =   1305.071
                  EndProperty
                  BeginProperty Column03 
                     ColumnWidth     =   1184.882
                  EndProperty
                  BeginProperty Column04 
                     ColumnWidth     =   2234.835
                  EndProperty
                  BeginProperty Column05 
                     Alignment       =   1
                     ColumnWidth     =   1500.095
                  EndProperty
                  BeginProperty Column06 
                     Button          =   -1  'True
                     Locked          =   -1  'True
                     Object.Visible         =   -1  'True
                     ColumnWidth     =   1604.976
                  EndProperty
                  BeginProperty Column07 
                     Button          =   -1  'True
                     Object.Visible         =   -1  'True
                     ColumnWidth     =   1470.047
                  EndProperty
                  BeginProperty Column08 
                     Button          =   -1  'True
                     Locked          =   -1  'True
                     ColumnWidth     =   945.071
                  EndProperty
                  BeginProperty Column09 
                     Button          =   -1  'True
                     Locked          =   -1  'True
                     ColumnWidth     =   1124.787
                  EndProperty
                  BeginProperty Column10 
                     Alignment       =   1
                     ColumnWidth     =   1035.213
                  EndProperty
                  BeginProperty Column11 
                     Locked          =   -1  'True
                  EndProperty
                  BeginProperty Column12 
                     Button          =   -1  'True
                     Locked          =   -1  'True
                  EndProperty
               EndProperty
            End
         End
         Begin ITGControls.ITGTextBox ITGTextBox4 
            Height          =   285
            Left            =   -74775
            TabIndex        =   27
            Top             =   1485
            Width           =   6930
            _ExtentX        =   12012
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Label           =   "Remarks"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1325
            TextBoxWidth    =   5545
            LinkForeColor   =   0
         End
         Begin VB.Label Label6 
            BackColor       =   &H00F7D9C2&
            Caption         =   "Currency"
            Height          =   240
            Left            =   -67335
            TabIndex        =   28
            Top             =   420
            Width           =   1305
         End
      End
      Begin ITGControls.ComunionFrames ComunionFrames5 
         Height          =   2070
         Left            =   0
         Top             =   1185
         Width           =   13095
         _ExtentX        =   23098
         _ExtentY        =   3651
         FrameColor      =   4210752
         BackColor       =   16243138
         FillColor       =   16243138
         RoundedCorner   =   0   'False
         Caption         =   ""
         Alignment       =   0
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ThemeColor      =   5
         ColorFrom       =   16243138
         ColorTo         =   16250865
         Begin VB.CommandButton cmdReference 
            Height          =   300
            Left            =   10470
            Picture         =   "frmBasicAPPMSEXPENSE.frx":023B
            Style           =   1  'Graphical
            TabIndex        =   25
            Top             =   600
            Visible         =   0   'False
            Width           =   315
         End
         Begin VB.CommandButton cmdPickCode 
            Height          =   300
            Left            =   2970
            Picture         =   "frmBasicAPPMSEXPENSE.frx":0385
            Style           =   1  'Graphical
            TabIndex        =   24
            Top             =   675
            Width           =   315
         End
         Begin ITGControls.ITGTextBox txtName 
            Height          =   285
            Left            =   3315
            TabIndex        =   14
            TabStop         =   0   'False
            Top             =   675
            Width           =   3735
            _ExtentX        =   6482
            _ExtentY        =   503
            BackColor       =   14737632
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Label           =   "ITGtext"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   0
            TextBoxWidth    =   3675
            Enabled         =   0   'False
         End
         Begin ITGControls.ITGTextBox txtCode 
            Height          =   285
            Left            =   360
            TabIndex        =   15
            Top             =   675
            Width           =   2550
            _ExtentX        =   4286
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Mandatory       =   -1  'True
            Label           =   "Employee ID"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   -1  'True
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1350
            TextBoxWidth    =   1140
            Hover           =   -1  'True
            Required        =   -1  'True
            LinkForeColor   =   16711680
         End
         Begin ITGControls.ITGTextBox txtRemarks 
            Height          =   285
            Left            =   360
            TabIndex        =   16
            Top             =   1050
            Width           =   6690
            _ExtentX        =   11589
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Label           =   "Remarks"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1350
            TextBoxWidth    =   5280
            Required        =   -1  'True
            LinkForeColor   =   0
         End
         Begin ITGControls.ITGTextBox txtDivisionDesc 
            Height          =   285
            Left            =   3315
            TabIndex        =   17
            TabStop         =   0   'False
            Top             =   1035
            Visible         =   0   'False
            Width           =   3735
            _ExtentX        =   6482
            _ExtentY        =   503
            BackColor       =   14737632
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Label           =   "ITGtext"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   0
            TextBoxWidth    =   3675
            Enabled         =   0   'False
         End
         Begin ITGControls.ITGTextBox txtDivision 
            Height          =   285
            Left            =   360
            TabIndex        =   18
            Top             =   1035
            Visible         =   0   'False
            Width           =   2550
            _ExtentX        =   4286
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Mandatory       =   -1  'True
            Label           =   "Division"
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1350
            TextBoxWidth    =   1140
            Required        =   -1  'True
         End
         Begin ITGControls.ComunionButton cmdPickDivision 
            Height          =   300
            Left            =   2955
            TabIndex        =   19
            Top             =   1020
            Visible         =   0   'False
            Width           =   330
            _ExtentX        =   582
            _ExtentY        =   529
            BTYPE           =   3
            TX              =   ""
            ENAB            =   -1  'True
            BeginProperty FONT {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            COLTYPE         =   1
            FOCUSR          =   -1  'True
            BCOL            =   14215660
            BCOLO           =   14215660
            FCOL            =   0
            FCOLO           =   0
            MCOL            =   12632256
            MPTR            =   1
            MICON           =   "frmBasicAPPMSEXPENSE.frx":04CF
            PICN            =   "frmBasicAPPMSEXPENSE.frx":04EB
            UMCOL           =   -1  'True
            SOFT            =   0   'False
            PICPOS          =   0
            NGREY           =   0   'False
            FX              =   3
            HAND            =   0   'False
            CHECK           =   0   'False
            VALUE           =   0   'False
         End
         Begin ITGControls.ITGDateBox dtbFrom 
            Height          =   285
            Left            =   9165
            TabIndex        =   20
            Tag             =   "Transaction Date"
            Top             =   1080
            Width           =   1305
            _ExtentX        =   2302
            _ExtentY        =   503
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   ""
            SendKeysTab     =   -1  'True
            Mandatory       =   -1  'True
         End
         Begin ITGControls.ComunionLabel ComunionLabel4 
            Height          =   285
            Left            =   7455
            TabIndex        =   21
            Top             =   1080
            Width           =   1620
            _ExtentX        =   2858
            _ExtentY        =   503
            Caption         =   "Period Covered"
            Enabled         =   -1  'True
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   0
         End
         Begin ITGControls.ITGDateBox dtbTo 
            Height          =   285
            Left            =   9165
            TabIndex        =   22
            Tag             =   "Transaction Date"
            Top             =   1440
            Width           =   1305
            _ExtentX        =   2302
            _ExtentY        =   503
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Text            =   ""
            SendKeysTab     =   -1  'True
            Mandatory       =   -1  'True
         End
         Begin ITGControls.ITGTextBox txtReference 
            Height          =   285
            Left            =   7440
            TabIndex        =   23
            Top             =   600
            Visible         =   0   'False
            Width           =   3000
            _ExtentX        =   5080
            _ExtentY        =   503
            SendKeysTab     =   -1  'True
            BackColor       =   12648447
            LabelBackColor  =   16243138
            BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            AllCaps         =   -1  'True
            Label           =   "Reference No."
            BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
               Name            =   "Tahoma"
               Size            =   8.25
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            LabelWidth      =   1680
            TextBoxWidth    =   1260
         End
      End
      Begin MSDataGridLib.DataGrid dtgList 
         Height          =   7380
         Left            =   -74970
         TabIndex        =   12
         Top             =   345
         Width           =   13050
         _ExtentX        =   23019
         _ExtentY        =   13018
         _Version        =   393216
         AllowUpdate     =   0   'False
         AllowArrows     =   -1  'True
         Appearance      =   0
         BackColor       =   16777215
         BorderStyle     =   0
         HeadLines       =   1
         RowHeight       =   15
         TabAction       =   2
         FormatLocked    =   -1  'True
         BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ColumnCount     =   6
         BeginProperty Column00 
            DataField       =   "cTranNo"
            Caption         =   "Trans. No."
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column01 
            DataField       =   "dDate"
            Caption         =   "Date"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   1
               Format          =   "MM/dd/yyyy"
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   3
            EndProperty
         EndProperty
         BeginProperty Column02 
            DataField       =   "cPJMNo"
            Caption         =   "Employee ID"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column03 
            DataField       =   "cType"
            Caption         =   "Type"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column04 
            DataField       =   "nGross"
            Caption         =   "Gross"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   1
               Format          =   "#,##0.00"
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   1
            EndProperty
         EndProperty
         BeginProperty Column05 
            DataField       =   "cRemarks"
            Caption         =   "Remarks"
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   1033
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            AllowRowSizing  =   0   'False
            BeginProperty Column00 
               ColumnAllowSizing=   -1  'True
               Locked          =   -1  'True
               ColumnWidth     =   1544.882
            EndProperty
            BeginProperty Column01 
               Locked          =   -1  'True
               ColumnWidth     =   1184.882
            EndProperty
            BeginProperty Column02 
               Locked          =   -1  'True
               ColumnWidth     =   1365.165
            EndProperty
            BeginProperty Column03 
               Locked          =   -1  'True
               ColumnWidth     =   1649.764
            EndProperty
            BeginProperty Column04 
               Alignment       =   1
               Locked          =   -1  'True
               ColumnWidth     =   1365.165
            EndProperty
            BeginProperty Column05 
               Locked          =   -1  'True
               ColumnWidth     =   4094.929
            EndProperty
         EndProperty
      End
      Begin ITGControls.ComunionLabel ComunionLabel2 
         Height          =   315
         Left            =   5040
         TabIndex        =   11
         Top             =   645
         Width           =   450
         _ExtentX        =   794
         _ExtentY        =   556
         Caption         =   "Date"
         Enabled         =   -1  'True
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   0
      End
      Begin VB.ComboBox cboType 
         Appearance      =   0  'Flat
         BackColor       =   &H00FFFFFF&
         Height          =   315
         ItemData        =   "frmBasicAPPMSEXPENSE.frx":0885
         Left            =   8505
         List            =   "frmBasicAPPMSEXPENSE.frx":088C
         Style           =   2  'Dropdown List
         TabIndex        =   10
         Top             =   600
         Width           =   1770
      End
      Begin ITGControls.ITGTextBox txtTranNo 
         Height          =   285
         Left            =   255
         TabIndex        =   9
         Top             =   630
         Width           =   2565
         _ExtentX        =   4313
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         AllCaps         =   -1  'True
         Mandatory       =   -1  'True
         Label           =   "Transaction No."
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   1350
         TextBoxWidth    =   1155
         Required        =   -1  'True
      End
      Begin ITGControls.ITGDateBox dtbDate 
         Height          =   285
         Left            =   5790
         TabIndex        =   8
         Tag             =   "Invoice Date"
         Top             =   630
         Width           =   1275
         _ExtentX        =   2249
         _ExtentY        =   503
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   ""
         SendKeysTab     =   -1  'True
         Mandatory       =   -1  'True
      End
      Begin ITGControls.ITGTextBox txtGross 
         Height          =   285
         Left            =   10005
         TabIndex        =   7
         TabStop         =   0   'False
         Top             =   6765
         Width           =   3045
         _ExtentX        =   5159
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BackColor       =   14737632
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   "0"
         DataType        =   1
         DecimalPlace    =   2
         Label           =   "Total Payables"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   1450
         TextBoxWidth    =   1535
         Enabled         =   0   'False
         LinkForeColor   =   0
      End
      Begin ITGControls.ComunionLabel ComunionLabel3 
         Height          =   315
         Left            =   7440
         TabIndex        =   6
         Top             =   630
         Width           =   1035
         _ExtentX        =   1826
         _ExtentY        =   556
         Caption         =   "Type"
         Enabled         =   -1  'True
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   0
      End
      Begin ITGControls.ITGTextBox txtOutputTax 
         Height          =   285
         Left            =   6750
         TabIndex        =   5
         TabStop         =   0   'False
         Top             =   7170
         Width           =   3030
         _ExtentX        =   5133
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BackColor       =   14737632
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   "0"
         DataType        =   1
         DecimalPlace    =   2
         Label           =   "Input Tax"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   1450
         TextBoxWidth    =   1520
         Enabled         =   0   'False
         LinkForeColor   =   0
      End
      Begin ITGControls.ITGTextBox txtEWT 
         Height          =   285
         Left            =   9990
         TabIndex        =   4
         TabStop         =   0   'False
         Top             =   7170
         Width           =   3045
         _ExtentX        =   5159
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BackColor       =   14737632
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   "0"
         DataType        =   1
         DecimalPlace    =   2
         Label           =   "EWT"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   1450
         TextBoxWidth    =   1535
         Enabled         =   0   'False
         LinkForeColor   =   0
      End
      Begin ITGControls.ITGTextBox txtExpense 
         Height          =   285
         Left            =   6750
         TabIndex        =   3
         TabStop         =   0   'False
         Top             =   6765
         Width           =   3030
         _ExtentX        =   5133
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BackColor       =   14737632
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   "0"
         DataType        =   1
         DecimalPlace    =   2
         Label           =   "Total Expenses"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   1450
         TextBoxWidth    =   1520
         Enabled         =   0   'False
         LinkForeColor   =   0
      End
      Begin ITGControls.ITGTextBox txtAdvance 
         Height          =   285
         Left            =   3495
         TabIndex        =   2
         TabStop         =   0   'False
         Top             =   6780
         Width           =   2805
         _ExtentX        =   4736
         _ExtentY        =   503
         SendKeysTab     =   -1  'True
         BackColor       =   12648447
         LabelBackColor  =   16243138
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Text            =   "0"
         DataType        =   1
         DecimalPlace    =   2
         Label           =   "Advances"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   1450
         TextBoxWidth    =   1295
         Enabled         =   0   'False
         LinkForeColor   =   0
      End
      Begin ITGControls.ITGTextBox txtType 
         Height          =   285
         Left            =   8985
         TabIndex        =   13
         Tag             =   "cboType"
         Top             =   615
         Visible         =   0   'False
         Width           =   1155
         _ExtentX        =   1931
         _ExtentY        =   503
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Mandatory       =   -1  'True
         Label           =   "Invoice Type"
         BeginProperty LabelFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         LabelWidth      =   0
         TextBoxWidth    =   1095
      End
   End
   Begin MSComctlLib.StatusBar sbRS 
      Align           =   2  'Align Bottom
      Height          =   285
      Left            =   0
      TabIndex        =   1
      Top             =   7980
      Width           =   13485
      _ExtentX        =   23786
      _ExtentY        =   503
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   5
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   3528
            MinWidth        =   3528
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
         EndProperty
         BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Alignment       =   1
            AutoSize        =   1
            Bevel           =   0
            Object.Width           =   10559
            MinWidth        =   2
         EndProperty
         BeginProperty Panel4 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   3528
            MinWidth        =   3528
         EndProperty
         BeginProperty Panel5 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Object.Width           =   3528
            MinWidth        =   3528
         EndProperty
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
End
Attribute VB_Name = "frmBasicAPPMSEXPENSE"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

'IT Group Inc. 2008.05.23

Option Explicit

'Object variables
'Private oNavRec As clsNavRec
'Private oLink As New clsLink

Private AutoNum As New clsAutoNumber '---Added
Public MenuName As String '---Added


Private oFormSetup As New clsFormSetup
Private oRecordset As New clsRecordset
Private oBar As New clsToolBarMenuBit
Private oPrint As New clsPrinting


'Recordset variables
Private WithEvents rsHeader As ADODB.Recordset
Attribute rsHeader.VB_VarHelpID = -1
Private rsDetail As ADODB.Recordset
Private rsDetVou As ADODB.Recordset

'Form mode enumeration
Enum eExpenseMode
    Normal
    AddNewEdit
    Find
End Enum
Public Mode As eExpenseMode

'Other declarations
Public dtgName As String
Public sBit As String
Private vBM As Variant 'Recordset bookmark variable
Public strNo As String, X As String, sType As String

Private lSystemGenerated As Boolean

Private lNetOK As Boolean
'ADO Connection variables
Private oConnection As New clsConnection
Private connHeader As ADODB.Connection
Private connDetail As ADODB.Connection

Private connDetvou As ADODB.Connection


'Security Acess Level variables
Public lACNew As Boolean
Public lACEdit As Boolean
Public lACDelete As Boolean
Public lACPost As Boolean
Public lACCancel As Boolean
Public lACPrint As Boolean

Private Sub cboParticular_Click()
    If dtgExpense.Col = 5 Then
        rsDetail!cParticulars = cboParticular
    End If
End Sub

Private Sub cboParticular_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        If dtgExpense.Col = 5 Then
            rsDetail!cParticulars = cboParticular
            cboParticular.Visible = False
            dtgExpense.Col = 6
            dtgExpense.SetFocus
        End If
    ElseIf KeyCode = vbKeyEscape Then
        cboParticular.Visible = False
    End If
End Sub

Private Sub cboParticular_LostFocus()
    cboParticular.Visible = False
End Sub

Private Sub cboAsk_Click()
    If dtgExpense.Col = 8 Then
        rsDetail!Cvat = cboAsk
        ComputeTotal
        ComputeTotalExpense
    ElseIf dtgExpense.Col = 9 Then
        rsDetail!cEWT = cboAsk
    End If
End Sub

Private Sub cboAsk_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        If dtgExpense.Col = 9 Then
            rsDetail!Cvat = cboAsk
            cboAsk.Visible = False
            dtgExpense.Col = 10
            dtgExpense.SetFocus
        ElseIf dtgExpense.Col = 10 Then
            rsDetail!cEWT = cboAsk
            cboAsk.Visible = False
            dtgExpense.Col = 11
            dtgExpense.SetFocus
        End If
    ElseIf KeyCode = vbKeyEscape Then
        cboAsk.Visible = False
    End If
End Sub

Private Sub cboAsk_LostFocus()
    cboAsk.Visible = False
End Sub

Private Sub cboTaxType_Click()
    If Mode = AddNewEdit Then
        If dtgExpense.Col = 9 Then
            rsDetail!cTaxType = cboTaxType
            rsDetail!nEWTRATE = CDbl(GetValueFrTable("cValue", "PARAMETER_USER", "cParamName = '" & cboTaxType & "' and cType='ATCCode'"))
            ComputeTotal
            ComputeTotalExpense
            
        End If
    End If
End Sub

Private Sub cboTaxType_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        If dtgExpense.Col = 9 Then
            rsDetail!cTaxType = cboTaxType
            cboTaxType.Visible = False
            dtgExpense.Col = 10
            dtgExpense.SetFocus
        End If
    ElseIf KeyCode = vbKeyEscape Then
        cboTaxType.Visible = False
    End If
End Sub

Private Sub cboTaxType_LostFocus()
    cboTaxType.Visible = False
End Sub

Private Sub cboClass_Click()
    If dtgExpense.Col = 0 Then
        rsDetail!cType = cboClass
    End If
End Sub

Private Sub cboClass_GotFocus()
    If dtgExpense.Col = 0 Then
        rsDetail!cType = cboClass
    End If
End Sub

Private Sub cboClass_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
        If dtgExpense.Col = 0 Then
            dtgExpense.Columns(0).Text = cboClass
            rsDetail!cType = cboClass
            cboClass.Visible = False
            dtgExpense.Col = 1
            dtgExpense.SetFocus
        End If
    ElseIf KeyCode = vbKeyEscape Then
        cboClass.Visible = False
    End If
End Sub

Private Sub cboClass_LostFocus()
    cboClass.Visible = False
End Sub

'Private Sub cmdPickDivision_Click()
'    If lPickListActive Then Exit Sub
'    PassFilterStringValue Trim(txtDivision)
'    frmITGPicker.zType = QDivision
'    frmITGPicker.Show vbModal
'    txtDivision = frmITGPicker.zCode
'    txtDivisionDesc = frmITGPicker.zName
'    If Trim(txtDivisionDesc) <> "" Then SendKeys "{Tab}"
'End Sub

Private Sub cmdPickCode_Click()
    If lPickListActive Then Exit Sub
    PassFilterStringValue Trim(txtCode)
    frmITGPicker.zType = QEmployee
    frmITGPicker.Show vbModal
    Me.cmdReference.Enabled = True
    txtCode = frmITGPicker.zCode
    txtName = frmITGPicker.zName
    txtDivision = GetValueFrTable("cDivision", "EMPLOYEE", "cEmpCode = '" & Trim(txtCode) & "'")
    If Trim(txtName) <> "" Then txtRemarks.SetFocus
End Sub

Private Sub cmdReference_Click()
    If Mode <> AddNewEdit Then Exit Sub
    RepName = Trim(txtCode)
    frmARCollectionList.mSIPick = ToSOE
    frmARCollectionList.Show vbModal
    Me.txtReference = frmARCollectionList.mcInvNo
    Me.txtAdvance = frmARCollectionList.mnBalance
End Sub

Private Sub dtgExpense_Scroll(Cancel As Integer)
    cboAsk.Visible = False
    cboTaxType.Visible = False
End Sub

Private Sub dtgList_HeadClick(ByVal ColIndex As Integer)
    SortGrid dtgList, ColIndex, rsHeader
End Sub

Private Sub dtgExpense_AfterColUpdate(ByVal ColIndex As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    Select Case ColIndex
        'Case 1
            'If dtgExpense.Columns(0).Text = "" Then Exit Sub
        Case 5
            ComputeTotal
            ComputeTotalExpense
        Case 6
            If GetValueFrTable("cAcctNo", "ACCOUNT", "cAcctNo = '" & Trim(dtgExpense.Columns(6).Text) & "' ") <> "" Then
                'dtgExpense.Col = 8
                'dtgExpense.Columns(8).Value = ""
                SendKeys "{tab}"
            End If
        Case 8
            ComputeTotal
            ComputeTotalExpense
        Case 9
            ComputeTotal
            ComputeTotalExpense
    End Select
End Sub

Private Sub dtgExpense_ButtonClick(ByVal ColIndex As Integer)
    If Mode = AddNewEdit Then 'Exit Sub
        Select Case ColIndex
'            Case 0
'                Call MoveCombo(cboClass, dtgExpense, dtgExpense.Columns(0))
'                ComboLoadValue cboClass, Trim(dtgExpense.Columns(0).Text)
                

                
'            Case 2
'                Call MoveCombo(DTPicker1, dtgExpense, dtgExpense.Columns(2))
'                ComboLoadValue DTPicker1, Trim(dtgExpense.Columns(2).Text)
'                dtgExpense.Col = 2
'                dtgExpense.Columns(2) = DTPicker1.Value
            Case 6  ' -- AccNo
                If lPickListActive Then Exit Sub
                PassFilterStringValue Trim(dtgExpense.Columns(6).Text)
                frmITGPicker.zType = QAccounts
                frmITGPicker.Show vbModal
                If Trim(frmITGPicker.zCode) = "" Then Exit Sub
                rsDetail!cAcctNo = Trim(frmITGPicker.zCode) & ""
                dtgExpense.Columns(6).Text = Trim(frmITGPicker.zCode) & ""
                'SendKeys "{tab}"
                'dtgExpense.Col = 8
                'dtgExpense.Columns(8) = ""
            
            
            Case 7 ' CCode
                If lPickListActive Then Exit Sub
                PassFilterStringValue Trim(dtgExpense.Columns(7).Text)
                'frmITGPicker3.zType = WSupplierNT
                frmITGPicker.zType = Qemployeesupplierall
                frmITGPicker.Show vbModal
                If Trim(frmITGPicker.zCode) = "" Then Exit Sub
                rsDetail!cCode = Trim(frmITGPicker.zCode) & ""
                Dim tin As String
                tin = GetValueFrTable("cTIN", "CLIENT_SUPPLIER_NT", "cCode = '" & Trim(frmITGPicker.zCode) & "'")
                If tin = "" Then
                        tin = GetValueFrTable("cTIN", "CLIENT_SUPPLIER", "cCode = '" & Trim(frmITGPicker.zCode) & "'")
                End If
                rsDetail!cTIN = tin
                dtgExpense.Col = 8
                dtgExpense.Columns(8) = "No"
            Case 8 '- Cvat
                Call MoveCombo(cboAsk, dtgExpense, dtgExpense.Columns(8))
                ComboLoadValue cboAsk, Trim(dtgExpense.Columns(8).Text)
                ComputeTotal
                ComputeTotalExpense
            Case 9 ' -Ctaxtype
                Call MoveCombo(cboTaxType, dtgExpense, dtgExpense.Columns(9))
                ComboLoadValue cboTaxType, Trim(dtgExpense.Columns(9).Text)
                ComputeTotal
                ComputeTotalExpense
            Case 12
                If lPickListActive Then Exit Sub
                frmITGPicker.zType = QProfitCenter
                'added condition
                frmITGPicker.Condition = "where cCompanyID = '" & COID & "'"
                frmITGPicker.Show vbModal
                dtgExpense.Columns(12).Value = frmITGPicker.zCode
        End Select
    Else
'''        Select Case ColIndex
'''        Case 2
'''            If Mode <> Find Then
'''                If Trim(dtgExpense.Columns(2).Text) <> "" Then
'''                    frmMaintProduct.Show
'''                    frmMaintProduct.ZOrder
'''                    frmMaintProduct.ShowForm LTrim(RTrim(dtgExpense.Columns(2).Text))
'''                End If
'''            End If
'''        End Select
    End If
End Sub

'Set the datagrid as active control
Private Sub dtgExpense_Click()
    If Mode = AddNewEdit Then dtgName = dtgExpense.Name
End Sub

Private Sub dtgExpense_Error(ByVal DataError As Integer, Response As Integer)
    Response = 0
End Sub

Private Sub dtgExpense_KeyDown(KeyCode As Integer, Shift As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    If (Shift = vbCtrlMask And KeyCode = 45) Then
        TBNewLine
    ElseIf (Shift = vbCtrlMask And KeyCode = 46) Then
        TBDeleteLine
    ElseIf (Shift = vbCtrlMask And KeyCode = 83) Then
        TBSave
    End If
End Sub

Private Sub dtgExpense_KeyPress(KeyAscii As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    If rsDetail.RecordCount = 0 Then Exit Sub
    If KeyAscii = 39 Then KeyAscii = 0 'Apostrophe {'}
    If KeyAscii = 13 Then
        Select Case dtgExpense.Col
            Case 4
                If Not cboParticular.Visible Then dtgExpense_ButtonClick (5)
            Case 5
                ComputeTotal
                ComputeTotalExpense
                'TBNewLine
                'SendKeys "{Tab}"
            Case 6
                If GetValueFrTable("cAcctNo", "ACCOUNT", "cAcctNo = '" & Trim(dtgExpense.Columns(6).Text) & "'") = "" Then
                    dtgExpense_ButtonClick (7)
                Else
                    SendKeys "{Tab}"
                End If
            Case 7
                dtgExpense_ButtonClick (7)
            Case 8
                If Not cboAsk.Visible Then dtgExpense_ButtonClick (8)
            Case 9
                If Not cboTaxType.Visible Then dtgExpense_ButtonClick (9)
            Case Else
                SendKeys "{Tab}"
        End Select
    Else: KeyAscii = Asc(UCase(Chr(KeyAscii)))        'All Upper Case String
    End If
End Sub

'Right click menu popup
Private Sub dtgExpense_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Mode <> AddNewEdit Then Exit Sub
    If Button = 2 Then
        dtgName = dtgExpense.Name
        PopupMenu ITGLedgerMain.mnuDetail
    End If
End Sub

Private Sub dtgVoucher_AfterColUpdate(ByVal ColIndex As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    Select Case ColIndex
        Case 3
            If val(Replace(dtgVoucher.Columns(3).Text, ",", "")) > val(dtgVoucher.Columns(4).Text) Then
                dtgVoucher.Columns(3).Text = val(dtgVoucher.Columns(4).Text)
                ComputeTotalVoucher
                MsgBox "Invalid Amount", vbInformation, "Error"
                Exit Sub
            End If
            ComputeTotalVoucher
    End Select
End Sub

Private Sub dtgVoucher_ButtonClick(ByVal ColIndex As Integer)
    If Mode = AddNewEdit Then 'Exit Sub
        Select Case ColIndex
        Case 2
        If txtCode = "" Then
            MsgBox "Please select employee.", vbExclamation, "Error"
            Exit Sub
        End If
        If val(txtExpense.Text) < val(txtAdvance.Text) Then
            MsgBox "You cannot pick another voucher because you has remaining advance amount.", vbExclamation, "Error"
            Exit Sub
        End If
        RepName = Trim(txtCode)
        frmARCollectionList.mSIPick = ToSOE
        frmARCollectionList.Show vbModal
        If frmARCollectionList.mcInvNo = "" Then Exit Sub
        If CheckVoucher(frmARCollectionList.mcInvNo) Then
            MsgBox "You cannot pick the same reference.", vbExclamation, "Error"
            Exit Sub
         End If
        dtgVoucher.Columns(2).Text = frmARCollectionList.mcInvNo
        dtgVoucher.Columns(3).Text = frmARCollectionList.mnBalance
        dtgVoucher.Columns(4).Text = frmARCollectionList.mnBalance
        ComputeTotalVoucher
        End Select
    End If
End Sub


Private Sub dtgVoucher_KeyPress(KeyAscii As Integer)
    If Mode <> AddNewEdit Then Exit Sub
    If rsDetVou.RecordCount = 0 Then Exit Sub
    If KeyAscii = 39 Then KeyAscii = 0 'Apostrophe {'}
    If KeyAscii = 13 Then
        Select Case dtgVoucher.Col
            Case 3
                ComputeTotalVoucher
            Case Else
                SendKeys "{Tab}"
        End Select
    Else: KeyAscii = Asc(UCase(Chr(KeyAscii)))        'All Upper Case String
    End If
End Sub

Private Sub dtgVoucher_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Mode <> AddNewEdit Then Exit Sub
    If Button = 2 Then
        dtgName = dtgVoucher.Name
        PopupMenu ITGLedgerMain.mnuDetail
    End If
End Sub



'Set Your Object
Private Sub Form_Load()
    Set FrmName = Me
    FormSetup
    AcessBit Me, GetValueFrTable("AccessLevel", "SEC_ACCESSLEVEL", "RoleID = '" & SecUserRole & "' AND [Module] = 'PMS01'")


    Set rsHeader = New ADODB.Recordset
    Set rsDetail = New ADODB.Recordset
    Set rsDetVou = New ADODB.Recordset
    'Set oNavRec = New clsNavRec



    'Load combobox
    Call LoadComboValues(cboTaxType, "cParamname", "PARAMETER_USER", "WHERE cType = 'ATCCode'", "nOrder")

    Set FrmName = Me
    oFormSetup.FormLocking True
    oFormSetup.FormSearch True
    SearchObj True
    
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, , , , , , , , , True, , , True
    BitVisible ITGLedgerMain.tbrMain, True, True
    ITGLedgerMain.tbrMain.Buttons("btnFind").ButtonMenus("btnFindP").Enabled = True
 

    Mode = Find
    txtTranNo.Locked = False
End Sub

'Activate your Toolbar Mode
Private Sub Form_Activate()
    TBBitReload
End Sub

'Release your Object
Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
    If Mode = AddNewEdit Then
        MsgBox "Unable to close. You are in Add/New/Edit mode." & vbCr & _
            " Must Save or Undo", vbCritical, Me.Caption
        Cancel = True
        Exit Sub
    End If
    
    CloseMenuTab ITGLedgerMain
    
    lNetOK = True
    
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , , , , , , , True
    BitVisible ITGLedgerMain.tbrMain
    ITGLedgerMain.tbrMain.Buttons("btnFind").ButtonMenus("btnFindP").Enabled = False
    

    'Set oNavRec = Nothing
    Set oFormSetup = Nothing
    'Set oRecordset = Nothing
    'Set oBar = Nothing
    
    Set oPrint = Nothing
    Set rsHeader = Nothing
    Set rsDetail = Nothing
    Set rsDetVou = Nothing
    
    Set connHeader = Nothing
    Set connDetail = Nothing
    Set connDetvou = Nothing
    
    Set frmBasicAPPMSEXPENSE = Nothing

    lCloseWindow = True

End Sub

'Add new record to the recordset
Public Sub TBNew()

    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , True, True, , , True, True, , , , True
    txtTranNo.BackColor = &HE0FFFF
    Mode = AddNewEdit

    If rsHeader.State <> adStateOpen Then
        oConnection.OpenNewConnection connDetail
        oConnection.OpenNewConnection connHeader
        oConnection.OpenNewConnection connDetvou
        
        oRecordset.OpenRecordsetWithCN rsDetail, "*", "PMS_EXPENSE_T", connDetail, "WHERE 1 = 0"
        oRecordset.OpenRecordsetWithCN rsHeader, "*", "PMS_EXPENSE", connHeader, "WHERE 1 = 0"
        oRecordset.OpenRecordsetWithCN rsDetVou, "*", "pms_voucher", connDetvou, "WHERE 1 = 0"
        SetDataSource
        SetDataField
    Else: vBM = rsHeader.Bookmark
    End If

    rsHeader.AddNew
    rsHeader!cCompanyID = COID
    rsHeader!dDate = Date
    rsHeader!cType = "Liquidation"

    Set FrmName = Me
    oFormSetup.FormLocking False
    oFormSetup.ClrRequired &HC0&
    txtDivision.Locked = True
    cmdPickDivision.Enabled = False
    txtReference.Locked = True
    cmdReference.Enabled = False
    
    SSTab1.ActiveTab = 0
    txtTranNo.SetFocus
    txtTranNo.Locked = True
    
    MenuName = "AUTO_NUMBER_LE"
    lSystemGenerated = GetValueFrTable("lAutoNo", "system_autonumber", "cCode = '" & MenuName & "'")
    If lSystemGenerated Then rsHeader!cTranNo = AutoNum.Generate_CtrlNo2(MenuName, Format(Now, "mm/dd/yyyy"))
    
    strNo = rsHeader!cTranNo
End Sub

'Undo all changes to the recordset
Public Sub TBUndoAll()
On Error GoTo ErrorHandler

    Mode = Normal
    
    If rsHeader.Status = adRecNew Then TBUndoCurrent
    
    rsHeader.CancelBatch adAffectAll
    rsDetail.CancelBatch adAffectAll
    rsDetVou.CancelBatch adAffectAll
    
    UnbindControls
    
    If rsHeader.RecordCount <> 0 Then rsHeader.Bookmark = vBM
    
    Set FrmName = Me
    FormLocking True
    
    If rsHeader.RecordCount <> 0 Then
        BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , lACPost, lACCancel, , , True, True, lACPrint, True
    Else
        RSZero
        Mode = Find
    End If

    sbRS.Panels(2) = ""
    
    SetDataSource
    SetDataField

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    ElseIf err.Number = -2147217842 Then
        TBUndoAll
    End If

End Sub

'Undo changes on the current record
Public Sub TBUndoCurrent()
On Error GoTo ErrorHandler

    GetChild
    If rsHeader.Status = adRecNew Then
        rsDetail.CancelBatch adAffectAll
        rsDetVou.CancelBatch adAffectAll
        rsHeader.CancelUpdate
    Else
        rsHeader.CancelBatch adAffectCurrent
        rsDetVou.CancelBatch adAffectCurrent
        rsDetail.CancelBatch adAffectAll
    End If

    If rsHeader.RecordCount = 0 Then RSZero

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    ElseIf err.Number = -2147217842 Then 'Operation was cancelled. (Error returned by ITGDateBox)
        TBUndoCurrent
    End If
End Sub

'Save all changes
Public Sub TBSave()
Dim OKUpdate As Boolean
Dim lNew As Boolean
On Error GoTo ErrHandler

    'Audit Trail
    lBoolean = False
    If rsHeader.Status = adRecNew Then lBoolean = True
    
    If Not MandatoryOK Then Exit Sub
    
    'System generated number
    If rsHeader.Status = adRecNew Then
        If lSystemGenerated Then
            'If ChkCtrlNo(rsHeader, "AUTO_NUMBER_LE", "PMS_EXPENSE", "cTranNo", rsHeader!cTranNo) <> rsHeader!cTranNo Then
            If AutoNum.Check_CtrlNo2(rsHeader, "PMS_EXPENSE", "cTranNo", rsHeader!cTranNo, MenuName, rsHeader!dDate) <> rsHeader!cTranNo Then
                GetChild
                
                rsHeader!cTranNo = strNo
                
                If rsDetail.RecordCount <> 0 Then rsDetail.MoveFirst
                Do Until rsDetail.EOF
                    rsDetail!cTranNo = strNo
                    rsDetail.MoveNext
                Loop
                
                GetChild
            End If
        End If
    End If

    OKUpdate = False
    cn.BeginTrans
    connHeader.BeginTrans
    connDetail.BeginTrans
    connDetvou.BeginTrans
    
    rsHeader.UpdateBatch adAffectAll
    rsDetail.UpdateBatch adAffectAll
    rsDetVou.UpdateBatch adAffectAll
    
    cn.CommitTrans
    connHeader.CommitTrans
    connDetail.CommitTrans
    connDetvou.CommitTrans
    OKUpdate = True

    Set FrmName = Me
    oFormSetup.FormLocking True
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , lACPost, lACCancel, , , True, True, True, True, True
    'oBar.BitEnabled Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , lACPost, lACCancel, , , True, True, lACPrint, True, lACPost
    Mode = Normal

    'Audit trail
    UpdateLogFile "Summary of Expenses", Trim(txtTranNo), IIf(lBoolean, "Inserted", "Updated")

    'Update GL Activity
    UpdateGLA "Update", "SOE", Trim(txtTranNo)

    'update system generated number
    If lBoolean Then
        If lSystemGenerated And strNo = rsHeader!cTranNo Then
            UpdateControlNo strNo, rsHeader!cTranNo, "AUTO_NUMBER_LE"
            AutoNum.Update_CtrlNo2 strNo, MenuName, Format(Now, "mm/dd/yyyy")
        End If
    End If
    
    MsgBox "Record/s successfully saved.", vbInformation, msgTtl
    sbRS.Panels(2) = ""
'---------------------------------

ErrHandler:

 If err.Number = -2147217885 Then
        Resume Next
    ElseIf err.Number = -2147217864 Then
        OKUpdate = True
        cn.RollbackTrans
        connHeader.RollbackTrans
        connDetail.RollbackTrans
        MsgBox "Record cannot be updated. Some values may have been changed by other user/s since last read." & vbCr & _
                "Records will be automatically refreshed. All changes made to the record will be gone upon refresh.", vbInformation, msgTtl
        vBookMark = rsHeader.Bookmark
        UnbindControls
        rsHeader.Requery
        rsDetail.Requery
        rsDetVou.Requery
        BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , lACPost, lACCancel, , , True, True, True, True
        Mode = Normal
        If rsHeader.RecordCount <> 0 Then
            Set FrmName = Me
            FormLocking True
            SetDataField
            SetDataSource
            rsHeader.Bookmark = vBookMark
        Else
            RSZero
        End If
    End If
    If Not OKUpdate Then
        MsgBox "Transaction update failed.", vbInformation, msgTtl
        cn.RollbackTrans
        connHeader.RollbackTrans
        connDetail.RollbackTrans
        ErrorLog err.Number, err.Description, Me.Name
    End If

End Sub

'Sets the form & recorset to add/edit mode
Public Sub TBEdit()
    If rsHeader!lCancelled = True Then
        MsgBox "Transaction was already cancelled. Edit is not allowed.", vbExclamation, msgTtl
        Exit Sub
    End If
    If rsHeader!lApproved = True Then
        MsgBox "Transaction was already approved. Edit is not allowed.", vbExclamation, msgTtl
        Exit Sub
    End If
    'If Not AllowEdit Then Exit Sub
    Mode = AddNewEdit
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , True, True, , , True, True, , , , True
    Set FrmName = Me
    oFormSetup.FormLocking False
    oFormSetup.ClrRequired &HC0&
'    txtGross.Locked = True
    txtTranNo.Locked = True
    txtDivision.Locked = True
    cmdPickDivision.Enabled = False
''    EditDetail True
    SSTab1.ActiveTab = 0
    dtbDate.SetFocus
    vBM = rsHeader.Bookmark
End Sub

'Delete record
Public Sub TBDelete()
On Error GoTo ErrorHandler

    sID = Trim(txtTranNo)

    If rsHeader.RecordCount = 0 Then Exit Sub

    If rsHeader!lCancelled = True Then
        MsgBox "Transaction was already cancelled. Deletion is not allowed.", vbExclamation, msgTtl
        Exit Sub
    End If
    If rsHeader!lApproved = True Then
        MsgBox "Transaction was already approved. Deletion is not allowed.", vbExclamation, msgTtl
        Exit Sub
    End If
    If MsgBox("Are you sure you want to delete this record?", vbQuestion + vbYesNo, msgTtl) = vbNo Then Exit Sub

''    If Not AllowDelete("delete") Then Exit Sub

    'Update GL Activity
    UpdateGLA "Delete", "SOE", Trim(txtTranNo)

    GetChild
    If rsDetail.RecordCount <> 0 Then
        rsDetail.MoveFirst
        Do Until rsDetail.RecordCount = 0
            rsDetail.Delete adAffectCurrent
            If rsDetail.RecordCount <> 0 Then rsDetail.MoveFirst
        Loop
    End If

    GetChild
    If rsDetVou.RecordCount <> 0 Then
        rsDetVou.MoveFirst
        Do Until rsDetVou.RecordCount = 0
            rsDetVou.Delete adAffectCurrent
            If rsDetVou.RecordCount <> 0 Then rsDetVou.MoveFirst
        Loop
    End If


    'Audit trail
    UpdateLogFile "Summary of Expense", Trim(txtTranNo), "Deleted"

    rsHeader.Delete adAffectCurrent

    rsDetail.UpdateBatch adAffectAll
    rsHeader.UpdateBatch adAffectAll
    rsDetVou.UpdateBatch adAffectAll
    MsgBox "Trasaction Number " & Trim(sID) & " has been deleted", vbInformation, msgTtl
    TBPrevRec

    Mode = Normal

    If rsHeader.RecordCount = 0 Then
        RSZero
    End If

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    ElseIf err.Number = -2147217864 Then
        cn.Execute "DELETE PMS_EXPENSE_T WHERE cTranNo = '" & sID & "' AND cCompanyID = '" & COID & "'"
        cn.Execute "DELETE PMS_EXPENSE WHERE cTranNo = '" & sID & "' AND cCompanyID = '" & COID & "'"
        Resume Next
    End If
End Sub

'Search using the frmITGSearch
Public Sub TBFind()
    Mode = Normal
    txtTranNo.Locked = True
    frmITGSearch.Show 'vbModal
End Sub

'Search using the recordset primary key
Public Sub TBFindPrimary()
Dim sTemp As String
If Mode = Find Then
    FormWaitShow App.Path & "\Transmit.avi", "Loading data . . ."

    oConnection.OpenNewConnection connHeader
    oConnection.OpenNewConnection connDetail
    oConnection.OpenNewConnection connDetvou
    Set rsHeader = Nothing
    Set rsDetail = Nothing
    Set rsDetVou = Nothing
    Set rsHeader = New ADODB.Recordset
    Set rsDetail = New ADODB.Recordset
    Set rsDetVou = New ADODB.Recordset

    sTemp = Trim$(GetSearchString)
    If sTemp = "ERROR" Then
        MsgBox "Only Allows A - Z, 0 - 9, '.', ',' and %(wildcard)", vbExclamation, ""
        BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, , , , , , , , , True, , , True
        txtTranNo.Locked = False
        txtTranNo.SetFocus
        Exit Sub
    End If

    oRecordset.OpenRecordsetWithCN rsHeader, "*", "PMS_EXPENSE", connHeader, IIf(sTemp = "", "", " WHERE " & sTemp)
    oRecordset.OpenRecordsetWithCN rsDetail, "*", "PMS_EXPENSE_T", connDetail, IIf(sTemp = "", "", " WHERE cTranNo IN (SELECT cTranNo FROM PMS_EXPENSE WHERE " & sTemp & ")")
    oRecordset.OpenRecordsetWithCN rsDetVou, "*", "pms_voucher", connDetvou, IIf(sTemp = "", "", " WHERE cTranNo IN (SELECT cTranNo FROM PMS_EXPENSE WHERE " & sTemp & ")")

    Set FrmName = Me
    oFormSetup.FormLocking True
      If rsHeader.RecordCount = 0 Then
        FormWaitHide
        'Unload frmWait
        MsgBox "No matching record/s found.", vbInformation, "ComUnion Search"
        RSZero
        oFormSetup.FormSearch True
        SearchObj True
        Mode = Find
        Exit Sub
    End If
    SetDataSource
    SetDataField
    txtTranNo.BackColor = &HE0FFFF
    Mode = Normal
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , lACPost, lACCancel, , , True, True, True, True, True

    FormWaitHide
Else
    RSZero
    oFormSetup.FormSearch True
    SearchObj True
    Mode = Find
End If
End Sub

'Reload menu buttons (do not delete this sub)
Public Sub TBBitReload()
    BitVisible ITGLedgerMain.tbrMain, True, True
    ITGLedgerMain.tbrMain.Buttons("btnFind").ButtonMenus("btnFindP").Enabled = True
    BitReload ITGLedgerMain, Me, ITGLedgerMain.tbrMain, sBit
    Set FrmName = Me
    dtgName = dtgExpense.Name
End Sub

'Close active window
Public Sub TBCloseWindow()
    Unload Me
End Sub

'Move first
Public Sub TBFirstRec()
    If rsHeader.State <> adStateOpen Then Exit Sub
    MoveFirst rsHeader
End Sub

'Move previuos
Public Sub TBPrevRec()
    If rsHeader.State <> adStateOpen Then Exit Sub
    MovePrevious rsHeader
End Sub

'Move next
Public Sub TBNextRec()
    If rsHeader.State <> adStateOpen Then Exit Sub
    MoveNext rsHeader
End Sub

'Move last
Public Sub TBLastRec()
    If rsHeader.State <> adStateOpen Then Exit Sub
    MoveLast rsHeader
End Sub

'Add new line to the detail recordset
Public Sub TBNewLine()
    If rsHeader!cTranNo = "" Then Exit Sub
    If Trim(txtCode.Text) = "" Then
        MsgBox "Employee Code is required before service selection.", vbInformation, msgTtl
        txtCode.SetFocus
        Exit Sub
    End If
    If dtgName = "dtgExpense" Then
        rsDetail.AddNew
        rsDetail!cCompanyID = COID
        rsDetail!cTranNo = Trim(rsHeader!cTranNo)
        dtgExpense.Col = 0
        GetChild
        If rsDetail.RecordCount <> 0 Then rsDetail.MoveLast
        dtgExpense.Col = 0
        dtgExpense.Columns(1).Value = ""
        dtgExpense.SetFocus
    End If
    
    If dtgName = "dtgvoucher" Then
        rsDetVou.AddNew
        rsDetVou!cCompanyID = COID
        rsDetVou!cTranNo = Trim(rsHeader!cTranNo)
        dtgVoucher.Col = 0
        GetChild
        If rsDetVou.RecordCount <> 0 Then rsDetVou.MoveLast
        dtgVoucher.Col = 0
        dtgVoucher.Columns(2).Value = ""
        dtgVoucher.Columns(3).Value = 0
        dtgVoucher.SetFocus
        
    End If
    
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , True, True, , , True, True, , , , True
 
End Sub

'Delete line in the detail recordset
Public Sub TBDeleteLine()
On Error GoTo ErrorHandler

    If dtgName = dtgExpense.Name Then
        If rsDetail.RecordCount = 0 Then Exit Sub
        vBookMark = dtgExpense.Bookmark
        GetChild
        dtgExpense.Bookmark = vBookMark
        rsDetail.Delete adAffectCurrent
        ComputeTotal
        ComputeTotalExpense
    End If
    
    If dtgName = dtgVoucher.Name Then
        If rsDetVou.RecordCount = 0 Then Exit Sub
        vBookMark = dtgVoucher.Bookmark
        GetChild
        dtgVoucher.Bookmark = vBookMark
        rsDetVou.Delete adAffectCurrent
        ComputeTotalVoucher
    End If
    
    
    GetChild

BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, , , , True, True, , , True, True, , , , True

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    End If
End Sub

'Undo All
Public Sub TBUndoLineAll()
On Error GoTo ErrorHandler

    MsgBox "Unavailable on " & Me.Name

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    End If

End Sub

'Undo current line
Public Sub TBUndoLineCurrent()
    MsgBox "Unavailable on " & Me.Name
End Sub

'Public Sub TBAccountAffected()
'    RepName = "EXPENSE"
'    frmAccountAffected.mModuleType = KEXPENSE
'    frmAccountAffected.mRefPK = txtTranNo.Text
'    frmAccountAffected.Show vbModal
'End Sub



'Post current record
Public Sub TBPostRecord()
On Error GoTo ErrorLevel
    
    If rsHeader.RecordCount = 0 Then Exit Sub

    If rsHeader!lCancelled = True Then
        MsgBox "Transaction was already cancelled. Approval is not allowed", vbExclamation, msgTtl
        Exit Sub
    End If
    
    If rsHeader!lApproved = True Then
        MsgBox "Transaction was already approved.", vbExclamation, msgTtl
        Exit Sub
    End If
    
    GetChild
    If rsDetail.RecordCount <> 0 Then rsDetail.MoveFirst
    Do Until rsDetail.EOF
        If IsNull(rsDetail!cAcctNo) Or Trim(rsDetail!cAcctNo) = "" Then
            MsgBox "Some of the details does not have accounts yet.", vbInformation, msgTtl
            Exit Sub
        End If
        rsDetail.MoveNext
    Loop
    
    If MsgBox("Are you sure you want to approve this record?", vbQuestion + vbYesNo, msgTtl) = vbNo Then Exit Sub

    'Audit trail
    UpdateLogFile "Summary of Expense", Trim(txtTranNo), "Approved"

    'Update GL Activity
    UpdateGLA "Update", "SOE", Trim(txtTranNo)
    
    cn.Execute ("UPDATE PMS_EXPENSE SET lApproved = 1 WHERE cTranNo = '" & Trim(txtTranNo) & "' AND cCompanyID = '" & COID & "'")
    cn.Execute ("UPDATE GLACTIVITY set lPosted = 1, dPosted = getdate() WHERE cTranNo = '" & Trim(txtTranNo) & "' AND cModule = 'SOE' AND cCompanyID = '" & COID & "'")
    
    sbRS.Panels(5) = "APPROVED"
    Mode = Normal
    
    rsHeader!lApproved = True
    rsHeader.UpdateBatch adAffectAll

ErrorLevel:
    If err.Number = -2147217885 Then
        Resume Next
    End If
End Sub

'Cancel current record
Public Sub TBCancelRecord()
On Error GoTo ErrorHandler

    If rsHeader.RecordCount = 0 Then Exit Sub

    If rsHeader!lCancelled = True Then
        MsgBox "Transaction was already cancelled.", vbExclamation, msgTtl
        Exit Sub
    End If

    If MsgBox("Are you sure you want to cancel this record?", vbQuestion + vbYesNo, msgTtl) = vbNo Then Exit Sub

''    If Not (AllowDelete("cancel")) Then Exit Sub

    'Audit trail
    UpdateLogFile "Summary of Expense", Trim(txtTranNo), "Cancelled"

    'Update GL Activity
    'UpdateGLA "Delete", "SummaryExpense", Trim(txtTranNo)

    cn.Execute ("UPDATE PMS_EXPENSE SET lCancelled = 1 WHERE cTranNo = '" & Trim(txtTranNo) & "' AND cCompanyID = '" & COID & "'")

    sbRS.Panels(5) = "CANCELLED"
    Mode = Normal

    rsHeader!lCancelled = True
    rsHeader.UpdateBatch adAffectAll

ErrorHandler:
    If err.Number = -2147217885 Then
        Resume Next
    End If
End Sub

'Print
Public Sub TBPrintRecord()
    If Trim(txtTranNo) = "" Then Exit Sub
    'RepName = GetValueFrTable("cParamName", "PARAMETER_USER", "cType = 'SIDOCTYPE' AND cValue = 'DOC 1'")
    cModule = "BasicSummaryExpense"
    oPrint.PrintReceipt Trim(txtTranNo)
End Sub

'Sets the data source of the controls
Sub SetDataSource()
    Set FrmName = Me
    BindControls rsHeader
    Set dtgList.DataSource = rsHeader
    Set dtgExpense.DataSource = rsDetail
    Set dtgVoucher.DataSource = rsDetVou
''    Set txtLongDesc.DataSource = rsDetail
End Sub

'Sets the data field for every bounded controls
Sub SetDataField()
    With rsHeader
        txtTranNo.DataField = !cTranNo
        dtbDate.DataField = !dDate
        txtType.DataField = !cType
        txtCode.DataField = !cCode
        txtDivision.DataField = !cDivisionID
        txtRemarks.DataField = !cRemarks
        txtOutputTax.DataField = !nVAT
        txtEWT.DataField = !nEWT
        txtExpense.DataField = !nExpense
        dtbFrom.DataField = !DFrom
        dtbTo.DataField = !DTo
        txtReference.DataField = !cReference
        txtAdvance.DataField = !nAdvance
        txtGross.DataField = !nGross
        txtAmount.DataField = !nAmount
    End With
End Sub

Private Sub rsHeader_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)
On Error GoTo ErrorHandler

    If Not (rsHeader.EOF) Or Not (rsHeader.BOF) Then
        'Status bar setup
        sbRS.Panels(1) = "Record: " & IIf((rsHeader.AbsolutePosition = -2), "0", rsHeader.AbsolutePosition) & "/" & rsHeader.RecordCount

        If rsHeader.Status <> adRecNew Then
            txtTranNo.Locked = True
        Else
            txtTranNo.Locked = False
        End If

        If Mode = AddNewEdit Then
            Select Case rsHeader.Status
                Case adRecNew
                    sbRS.Panels(2) = "New"
                Case adRecModified
                    sbRS.Panels(2) = "Modified"
                Case Else
                    sbRS.Panels(2) = ""
            End Select
        Else: sbRS.Panels(2) = ""
        End If

        GetChild
'        ShowInvoiceBalance

        If rsHeader!lCancelled = True Then
            sbRS.Panels(5) = "CANCELLED"
        ElseIf rsHeader!lApproved = True Then
            sbRS.Panels(5) = "APPROVED"
        Else: sbRS.Panels(5) = ""
        End If
    Else
        sbRS.Panels(1) = "Record: 0/0"
        sbRS.Panels(2) = ""
        txtTranNo.Locked = False
    End If

    If Mode = AddNewEdit Then
        dtgExpense.Refresh
        dtgVoucher.Refresh
    End If
ErrorHandler:
    'Err.Number -2147217885
    'Description - Row handle referred to a deleted row or a row marked for deletion.
    If err.Number = -2147217885 Then
        Resume Next
    End If
End Sub

Private Sub Timer1_Timer()
    If Mode = AddNewEdit Then
        SSTab1.TabEnabled(1) = False
    Else
        SSTab1.TabEnabled(1) = True
    End If
End Sub

Private Sub txtCode_Change()
    txtName = ""
    txtName = GetValueFrTable("cEmpName", "EMPLOYEE", "cEmpCode = '" & Trim(txtCode) & "'")
End Sub



Private Sub txtCode_LostFocus()
    If Mode <> AddNewEdit Then Exit Sub
    If Trim(txtName) = "" And Trim(txtCode) <> "" Then cmdPickCode_Click
End Sub

Private Sub txtTranNo_LostFocus()
    'Does Code Already Exist
    If Mode = AddNewEdit Then
        If Trim(txtTranNo) = "" Then
            MsgBox "Empty primary input.", vbInformation, msgTtl
            txtTranNo.SetFocus
        Else
            If rsHeader.Status <> adRecNew Then Exit Sub
            txtTranNo = Trim(txtTranNo)
            If IDExisting(rsHeader, "cTranNo", "PMS_Expense", Trim(rsHeader!cTranNo)) Then
                MsgBox "Request for Billing already exist.", vbInformation, msgTtl
                txtTranNo.SetFocus
            End If
        End If
    End If
End Sub

Private Sub txtDivision_Change()
    txtDivisionDesc = ""
    txtDivisionDesc = GetValueFrTable("cDivName", "PMS_DIVISION", "cDivisionID = '" & Trim(txtDivision) & "'")
End Sub

'Private Sub txtDivision_LostFocus()
'    If Mode <> AddNewEdit Then Exit Sub
'    If Trim(txtDivisionDesc) = "" And Trim(txtDivision) <> "" Then cmdPickDivision_Click
'End Sub

Private Sub cboType_Click()
    txtType = Trim(cboType)
    If Mode <> AddNewEdit Then Exit Sub
    If txtType = "Liquidation" Then
        Me.txtReference.Locked = False
        Me.cmdReference.Enabled = True
    Else
        Me.txtReference.Locked = True
        Me.cmdReference.Enabled = False
    End If
End Sub

Private Sub cboType_KeyPress(KeyAscii As Integer)
    SendKeysTab KeyAscii
End Sub

Private Sub txtType_Change()
    If Trim(txtType) <> "" Or txtType <> vbNullString Then
        cboType = Trim(txtType)
    Else: cboType.ListIndex = -1
    End If
End Sub

'Check if all mandatory fields are complete
Function MandatoryOK() As Boolean

    MandatoryOK = True

    If Trim(txtTranNo) = "" Then
        MandatoryOK = False
        MsgBox "Field 'Invoice Number' is mandatory. Null value is not allowed.", vbInformation, msgTtl
        txtTranNo.SetFocus
        Exit Function
    End If

    ComputeTotal
    ComputeTotalExpense

    If txtAdvance <> txtAmount Then
        MsgBox "Unbalanced transaction details.", vbCritical, msgTtl
        MandatoryOK = False
        Exit Function
    End If

    If rsHeader.Status = adRecNew And lSystemGenerated = False Then
        If IDExisting(rsHeader, "cTranNo", "PMS_Expense", Trim(rsHeader!cTranNo)) Then
            MandatoryOK = False
            MsgBox "Summary of Expense already exist.", vbInformation, msgTtl
            txtTranNo.SetFocus
            Exit Function
        End If
    End If

    'Required fields
    If Trim(dtbDate.Text) = "__/__/____" Then
        MandatoryOK = False
        MsgBox "Field 'Transaction Date' is mandatory. Null value is not allowed.", vbInformation, msgTtl
        dtbDate.SetFocus
        Exit Function
'    ElseIf Trim(txtType) = "" Then
'        MandatoryOK = False
'        MsgBox "Field 'Type' is mandatory. Null value is not allowed.", vbInformation, msgttl
'        cboType.SetFocus
'        Exit Function
    ElseIf Trim(txtCode) = "" Then
        MandatoryOK = False
        MsgBox "Field 'Customer' is mandatory. Null value is not allowed.", vbInformation, msgTtl
        txtCode.SetFocus
        Exit Function
    ElseIf Trim(txtRemarks) = "" Then
        MandatoryOK = False
        MsgBox "Field 'Remarks' is mandatory. Null value is not allowed.", vbInformation, msgTtl
        txtRemarks.SetFocus
        Exit Function
    End If

    GetChild

    'Transaction without details
    If rsDetail.RecordCount = 0 Then
        MandatoryOK = False
        MsgBox "Cannot save transaction without details.", vbInformation, msgTtl
        dtgExpense.SetFocus
        Exit Function
    End If



    GetChild

    If rsDetail.RecordCount <> 0 Then rsDetail.MoveFirst
    Do Until rsDetail.EOF
        If IsNull(rsDetail!cParticulars) Or Trim(rsDetail!cParticulars) = "" Then
            MandatoryOK = False
            MsgBox "Particulars is required.", vbInformation, msgTtl
            Exit Function
        End If
        If Not IsNull(rsDetail!cAcctNo) Or Trim(rsDetail!cAcctNo) <> "" Then
            If GetValueFrTable("cAcctNo", "ACCOUNT", "cAcctNo = '" & rsDetail!cAcctNo & "'") = "" Then
                MandatoryOK = False
                MsgBox "Account does not exists. Please check appropriate entries!", vbInformation, msgTtl
                Exit Function
            End If
        End If
        rsDetail.MoveNext
    Loop

    If rsDetail.RecordCount < 1 Then
        MsgBox "Cannot save transaction without details.", vbExclamation, msgTtl
        MandatoryOK = False
        Exit Function
    End If
    
    GetChild
    
    If rsDetVou.RecordCount < 1 Then
        MsgBox "Cannot save transaction without details.", vbExclamation, msgTtl
        MandatoryOK = False
        Exit Function
    End If


    GetChild

    If rsDetail.RecordCount < 1 Then
        MsgBox "Cannot save transaction without details.", vbExclamation, msgTtl
        MandatoryOK = False
        Exit Function
    End If
End Function

'Filter detail recordset to header's primary
Private Sub GetChild()
    rsDetail.Filter = "cTranNo = '" & Trim(rsHeader!cTranNo) & "'"
    rsDetVou.Filter = "cTranNo = '" & Trim(rsHeader!cTranNo) & "'"
End Sub


'Sets the form if record number is zero
Private Sub RSZero()
    sbRS.Panels(1) = "Record: 0/0"
    sbRS.Panels(2) = ""
    sbRS.Panels(4) = ""
    sbRS.Panels(5) = ""

    Set dtgExpense.DataSource = Nothing
    Set dtgVoucher.DataSource = Nothing
    dtgExpense.Refresh
    dtgVoucher.Refresh


    Set FrmName = Me
    UnbindControls
    TextClearing
    FormLocking True

    If rsHeader.State = adStateOpen Then rsHeader.Close
    If rsDetail.State = adStateOpen Then rsDetail.Close
    If rsDetVou.State = adStateOpen Then rsDetVou.Close
    BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, , , , , , , , , True, , , True

    txtTranNo.Locked = False
    txtTranNo.SetFocus

    Mode = Find

End Sub

Sub SearchObj(lEnable As Boolean)
    dtbDate.Enabled = lEnable
    cboType.Enabled = lEnable

End Sub

'Form list to grid
'
'
'Public Sub AddDetailsFromProject()
'
'
'    If rsDetail!cType = "Project" Then
'        'GetChild
'        With frmPMSPicker.lvwList
'            For i = 1 To .ListItems.Count
'                If .ListItems(i).Checked = True Then
'                    If rsDetail!cTranNo <> "" Then rsDetail.AddNew
'                    rsDetail!cCompanyID = COID
'                    rsDetail!cTranNo = Trim(rsHeader!cTranNo)
'                    rsDetail!cType = "Project"
'                    rsDetail!cProjectID = Trim(.ListItems(i).Text)
'                    rsDetail!cDesc = Trim(.ListItems(i).SubItems(1))
'                    'rsDetail!cDivisionID = Trim(.ListItems(i).SubItems(2))
'                    'rsDetail!nServiceFee = CDbl(Trim(.ListItems(i).SubItems(3)))
'                End If
'            Next i
'        End With
'        If rsDetail.RecordCount <> 0 Then rsDetail.MoveFirst
'        Do Until rsDetail.EOF
'            If rsDetail.Status = (adRecNew) Or rsDetail.Status = (adRecModified) Then
'                If IsNull(rsDetail!cProjectID) Then
'                    rsDetail.Delete
'                ElseIf Trim(rsDetail!cProjectID) = "" Then
'                    rsDetail.Delete
'                Else
'                    rsDetail.MoveNext
'                End If
'            Else
'                rsDetail.MoveNext
'            End If
'        Loop
'        'GetChild
'    Else
'        rsDetail!cProjectID = frmPMSPicker.lvwRef.SelectedItem
'        rsDetail!cDesc = GetValueFrTable("cLeadTitle", "PMS_LEAD", "cLeadID = '" & Trim(rsDetail!cProjectID) & "'")
'        dtgExpense.Col = 3
'    End If
'
'End Sub
Function CheckVoucher(RefID As String) As Boolean
On Error Resume Next
    If Mode <> AddNewEdit Then Exit Function
    Set rs = New Recordset
    Set rs = rsDetVou.Clone
    rs.Filter = "cTranNo = '" & Trim(rsHeader!cTranNo) & "'"
    rs.MoveFirst
    Do Until rs.EOF
        If rs!cReference = RefID Then
            CheckVoucher = True
            Exit Function
        End If
        rs.MoveNext
    Loop
    Set rs = Nothing
End Function

'Gross amount
Public Sub ComputeTotalVoucher()
Dim nxTotal As Double
On Error Resume Next

    If Mode <> AddNewEdit Then Exit Sub
        nxTotal = 0
    Set rs = New Recordset
    Set rs = rsDetVou.Clone
    rs.Filter = "cTranNo = '" & Trim(rsHeader!cTranNo) & "'"
    rs.MoveFirst
    Do Until rs.EOF
        nxTotal = nxTotal + rs!nAmount
        rs.MoveNext
    Loop
    Set rs = Nothing

    rsHeader!nAdvance = Round(nxTotal, 2)
End Sub

Public Sub ComputeTotalExpense()
Dim nxTotal As Double
On Error Resume Next
    If Mode <> AddNewEdit Then Exit Sub
        nxTotal = 0
    Set rs = New Recordset
    Set rs = rsDetail.Clone
    rs.Filter = "cTranNo = '" & Trim(rsHeader!cTranNo) & "'"
    rs.MoveFirst
    Do Until rs.EOF
        nxTotal = nxTotal + rs!nAmount
        rs.MoveNext
    Loop
    Set rs = Nothing
    rsHeader!nAmount = Round(nxTotal, 2)
    txtAmount.Text = Round(nxTotal, 2)
End Sub
'Gross amount
Public Sub ComputeTotal()
Dim nxPayable, nxTax, nxEWT, nxTotal, nxExpense As Double

On Error Resume Next

    If Mode <> AddNewEdit Then Exit Sub

    nxPayable = 0
    nxExpense = 0
    nxTotal = 0
    nxTax = 0
    nxEWT = 0
    
    Set rs = New Recordset
    Set rs = rsDetail.Clone
    rs.Filter = "cTranNo = '" & Trim(rsHeader!cTranNo) & "'"
    rs.MoveFirst
    Do Until rs.EOF
        If rs!nEWTRATE <> 0 Then
            If rs!Cvat = "Yes" Then
                nxPayable = nxPayable + rs!nAmount - ((rs!nAmount / getTax) * (rs!nEWTRATE / 100))
            Else
                nxPayable = nxPayable + rs!nAmount - (rs!nAmount * (rs!nEWTRATE / 100))
            End If
        Else
            nxPayable = nxPayable + rs!nAmount
        End If
        If rs!Cvat = "Yes" Then
            nxTax = nxTax + (rs!nAmount - (rs!nAmount / getTax))
        Else
            nxTax = nxTax + 0
        End If
        nxTotal = nxTotal + rs!nAmount
        rs.MoveNext
    Loop
    Set rs = Nothing

    rsHeader!nGross = Round(nxPayable, 2)
    rsHeader!nEWT = nxTotal - Round(nxPayable, 2)
    rsHeader!nExpense = nxTotal - Round(nxTax, 2)
    rsHeader!nVAT = Round(nxTax, 2)
End Sub

Private Function GetSearchString() As String
On Error GoTo ErrorHandler
Dim sWhere As String

    GetSearchString = True

    If Trim$(txtTranNo.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cTranNo LIKE '" & Trim$(txtTranNo.Text) & "%'"
    End If

    If Trim$(dtbDate.Text) <> "__/__/____" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " dDate = '" & Trim$(dtbDate.Text) & "'"
    End If

'    If Trim$(txtType.Text) <> "" Then
'        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cType LIKE '" & Trim$(txtType.Text) & "%'"
'    End If

    If Trim$(txtCode.Text) <> "" Then
        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cPJMNo LIKE '" & Trim$(txtCode.Text) & "%'"
    End If
    
'    If Trim$(sDivision) <> "ADM" Then
'        sWhere = sWhere & IIf(Trim$(sWhere) = "", "", " AND ") & " cDivisionID = '" & Trim$(sDivision) & "'"
'    End If

    GetSearchString = Trim$(sWhere)

    Exit Function
ErrorHandler:
    GetSearchString = "ERROR"
End Function

'Passing string value to variable 'sFilterString'
Public Sub PassFilterStringValue(str As String)
    If Trim(str) <> "" Then
        sFilterString = Trim(str)
    Else
        sFilterString = ""
    End If
End Sub

Public Sub TBAccountAffected()
    RepName = "EXPENSE"
    frmAccountAffected.mModuleType = KEXPENSE
    frmAccountAffected.mRefPK = txtTranNo.Text
    frmAccountAffected.Show vbModal
End Sub


Public Sub ShowForm(sTranNo As String)
    If Mode = Find Then

    oConnection.OpenNewConnection connHeader
    oConnection.OpenNewConnection connDetail
    oConnection.OpenNewConnection connDetvou
    Set rsHeader = Nothing
    Set rsDetail = Nothing
    Set rsDetVou = Nothing
    Set rsHeader = New ADODB.Recordset
    Set rsDetail = New ADODB.Recordset
    Set rsDetVou = New ADODB.Recordset


    oRecordset.OpenRecordsetWithCN rsHeader, "*", "PMS_EXPENSE", connHeader, "WHERE cTranNo = '" & Trim(sTranNo) & "'"
    oRecordset.OpenRecordsetWithCN rsDetail, "*", "PMS_EXPENSE_T", connDetail, "WHERE cTranNo = '" & Trim(sTranNo) & "'"
    oRecordset.OpenRecordsetWithCN rsDetVou, "*", "pms_voucher", connDetvou, "WHERE cTranNo = '" & Trim(sTranNo) & "'"

        Set FrmName = Me
        FormLocking True

        If rsHeader.RecordCount = 0 Then
            FormWaitHide
            MsgBox "No matching record/s found.", vbInformation, "ComUnion Search"
            RSZero
            FormSearch True
            SearchObj True
            Mode = Find
            Exit Sub
        End If
            SetDataSource
            SetDataField
            txtTranNo.BackColor = &HE0FFFF
            Mode = Normal
            BitEnabled ITGLedgerMain, Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , lACCancel, , , True, True, lACPrint, True, True

            'BitEnabled Me, ITGLedgerMain.tbrMain, lACNew, lACEdit, lACDelete, , , , , , , True, True, , True, True

    End If
End Sub
